RunFunction Method (string, object[], ref object[])
Runs an XJEase function with the specified name from the project's circuit code files. The XJEase function is run synchronously i.e. control does not return from this method until the function has completed.
Type: Runner
Namespace: XJTAG.Integration.XJRunner
Syntax
public void RunFunction(string functionName, object[] inputArgs, ref object[] outputArgs)
Parameters
- functionName
Type: string
The name of the XJEase test function to run.
- inputArgs
Type: object[]
The input arguments for the function. An arbitrary number of string and integer arguments can be given, corresponding to the parameters for the function to be run.
- outputArgs
Type: object[]
The initial values for the output arguments; individual arguments can be initialised as null. This output array is modified by the function that is run and passed back out.
Exceptions
- RuntimeException
There was an error running the XJEase code.
- System.ArgumentException
The function name was an empty string.
- System.ArgumentNullException
Any of the arguments were null.
- System.ObjectDisposedException
The RunnerProject has already been disposed.
Example
In this case we call RunFunction on a Runner object to run an XJEase function from the project circuit code files.
class Testing { Runner runner; void InitialiseRunner() { /* * ... * Code to obtain Runner object from project. * ... */ // Initialise the arrays for the input and output arguments. object[] inputArgs = new object[] { 1, "hello" }; object[] outputArgs = new object[] { null }; // Run a function. runner.RunFunction("TestFunction", inputArgs, ref outputArgs); } }
XJTAG v4.2.5
